﻿function ScribeSignal() {
    this.ScribeHub = $.connection.ScribeMini;
    this.LogArea = null;
    this.InputArea = null;
    //this.ScribeRecievedFunc = null;

    this.Initialize = function (pLogArea) {
        var bizObject = MASTER_GetCurrentBusinessObject();
        if (bizObject != null) {
            this.ScribeHub.server.addToIncident(bizObject.ID).done(function () {
                $.connection.ScribeMini.server.getScribeLogAfter(0).done(function (scribes) {                    
                    scribesRecieved(scribes);
                })
            }).fail(function (error) { alert(error); });
        }
    };
    // Start the connection
    //$.connection.hub.start().done(init);
}

function ChatSignal() {
    this.ERMChatHub = $.connection.ERMChatHub;
    this.LogArea = null;
    this.InputArea = null;
    //this.ScribeRecievedFunc = null;

    this.Initialize = function () {
        var bizObject = MASTER_GetCurrentBusinessObject();
        if (bizObject != null) {
            this.ERMChatHub.server.addToIncident(bizObject.ID).done(function () {
                $.connection.ERMChatHub.server.getChatLogAfter(0).done(function (chatLog) {
                    chatRecieved(chatLog);
                })
            }).fail(function (error) { alert(error); });
        }
    };
    // Start the connection
    //$.connection.hub.start().done(init);
}
